<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Utils Test</title>
<script type="text/javascript" src="../liwe.js"></script>
<script type="text/javascript" src="../types.js"></script>
<script type="text/javascript" src="../types.tree.js"></script>
<script type="text/javascript" src="../types.dotdict.js"></script>
<script type="text/javascript">
function test_dict  ()
{
	var s = dict ();

	console.debug ( s );
};

function test_tree ()
{
	var t = tree ();
	var n;

	n = t.add ( "1" );
		n.add ( "1-1" );
		n.add ( "1-2" );
		n.add ( "1-3" );

	n = t.add ( "2" );
		n.add ( "2-1" );
		n.add ( "2-2" );
		n.add ( "2-3" );

	t.traverse ( function ( v ) { console.debug ( "%o", v ); } );
};

function test_dotdict ()
{
	var a = {
		"a" : {
			"b" : {
				"c" : 42
			},

			"x" : {
				"x" : 10
			}
		},
		
		"b" : {
			"c" : 10
		}
	};

	var d = new dotdict ( a );

	console.debug ( "a.b.c: %s - a.x.x: %s - a.x.y: %s", d.get ( "a.b.c" ), d.get ( "a.x.x" ), d.get ( "a.x.y" ) );
};
</script>
</head> 
<body>
<a href="javascript:test_dict()">Test dict</a>
<a href="javascript:test_tree()">Test tree</a>
<a href="javascript:test_dotdict()">Test dotdict</a>


</body>
</html>
